package com.ctshk.rpc.train.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctshk.rpc.train.dto.TrainProductCostPriceDTO;
import com.ctshk.rpc.train.entity.TrainProducCostPrice;
import com.ctshk.rpc.train.mapper.TrainProducCostPriceMapper;
import com.ctshk.rpc.train.mapper.TrainProductCostMapper;
import com.ctshk.rpc.train.service.ITrainProductCostPriceService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 火车票成本价格表 服务实现类
 * </p>
 *
 * @author 彭柳霖
 * @since 2021-03-11
 */
@DubboService
public class TrainProductCostPriceServiceImpl extends ServiceImpl<TrainProducCostPriceMapper, TrainProducCostPrice> implements ITrainProductCostPriceService {

    @Autowired
    private TrainProductCostMapper trainProductCostMapper;

    /**
     * 根据日期查询产品成本价格信息
     */
    @Override
    public List<TrainProductCostPriceDTO> queryPrice(Long trainProductId, LocalDate queryDate) {
        List<TrainProductCostPriceDTO> trainProductCostPriceDTOList = trainProductCostMapper.queryPrice(trainProductId,queryDate);
        return trainProductCostPriceDTOList;
    }
}
